package jh.model;

import java.util.ArrayList;
import java.util.List;

public class MModel {


    private String lotteryCategoryName;
    private String parentLotteryCategoryCode;
    private String lotteryPeriods;
    private String lotteryCategoryLogoUrl;
    private String lotteryOpenTime;
    private String lotteryOpenNumber;
    private String lotteryCategoryCode;
    private String nextOpenTime;

    public String getLotteryCategoryName() {
        return lotteryCategoryName;
    }

    public void setLotteryCategoryName(String lotteryCategoryName) {
        this.lotteryCategoryName = lotteryCategoryName;
    }

    public String getParentLotteryCategoryCode() {
        return parentLotteryCategoryCode;
    }

    public void setParentLotteryCategoryCode(String parentLotteryCategoryCode) {
        this.parentLotteryCategoryCode = parentLotteryCategoryCode;
    }

    public String getLotteryPeriods() {
        return lotteryPeriods;
    }

    public void setLotteryPeriods(String lotteryPeriods) {
        this.lotteryPeriods = lotteryPeriods;
    }

    public String getLotteryCategoryLogoUrl() {
        return lotteryCategoryLogoUrl;
    }

    public void setLotteryCategoryLogoUrl(String lotteryCategoryLogoUrl) {
        this.lotteryCategoryLogoUrl = lotteryCategoryLogoUrl;
    }

    public String getLotteryOpenTime() {
        return lotteryOpenTime;
    }

    public void setLotteryOpenTime(String lotteryOpenTime) {
        this.lotteryOpenTime = lotteryOpenTime;
    }

    public String getLotteryOpenNumber() {
        return lotteryOpenNumber;
    }

    public void setLotteryOpenNumber(String lotteryOpenNumber) {
        this.lotteryOpenNumber = lotteryOpenNumber;
    }

    public String getLotteryCategoryCode() {
        return lotteryCategoryCode;
    }

    public void setLotteryCategoryCode(String lotteryCategoryCode) {
        this.lotteryCategoryCode = lotteryCategoryCode;
    }

    public String getNextOpenTime() {
        return nextOpenTime;
    }

    public void setNextOpenTime(String nextOpenTime) {
        this.nextOpenTime = nextOpenTime;
    }


    public static String nuinui(String[] array){

        int index,index1,index2;

        List<Integer> list = new ArrayList<>();
        for(int i=0;i<array.length;i++){
            list.add(Integer.parseInt(array[i]));
        }

        for (int i=0; i<list.size() - 2; i++) {
            int value2 = list.get(i);
            index = i;
            for (int j=i+1; j<list.size() - 1; j++) {
                index1 = j;
                int value1 = list.get(j);
                for (int k=j+1; k<list.size(); k++) {
                    int value = list.get(k);
                    index2 = k;
                    if ((value + value1 + value2) % 10 == 0) {

                        list.remove(index);
                        list.remove(index1 - 1);
                        list.remove(index2 - 2);
                        int sum = list.get(0) + list.get(1);
                        return "牛"+dy(sum % 10);
                    }
                }
            }
        }
        return "无牛";


    }

    public static String dy(int num) {

        switch (num) {
            case 1:
                return "一";
            case 2:
                return "二";
            case 3:
                return "三";
            case 4:
                return "四";
            case 5:
                return "五";
            case 6:
                return "六";
            case 7:
                return "七";
            case 8:
                return "八";
            case 9:
                return "九";
            default:
                return "牛";

        }
    }



    public static String getType(String value){

        if (value.equals("01") || value.equals("13") || value.equals("25") || value.equals("37") || value.equals("49")){
            return "猪";
        }else if (value.equals("02") || value.equals("14") || value.equals("26") || value.equals("38")){
            return "狗";
        }else if (value.equals("03") || value.equals("15") || value.equals("27") || value.equals("39")){
            return "鸡";
        }else if (value.equals("04") || value.equals("16") || value.equals("28") || value.equals("40")){
            return "猴";
        }else if (value.equals("05") || value.equals("17") || value.equals("29") || value.equals("41")){
            return "羊";
        }else if (value.equals("06") || value.equals("18") || value.equals("30") || value.equals("42")){
            return "马";
        }else if (value.equals("07") || value.equals("19") || value.equals("31") || value.equals("43")){
            return "蛇";
        }else if (value.equals("08") || value.equals("20") || value.equals("32") || value.equals("44")){
            return "龙";
        }else if (value.equals("09") || value.equals("21") || value.equals("33") || value.equals("45")){
            return "兔";
        }else if (value.equals("10") || value.equals("22") || value.equals("34") || value.equals("46")){
            return "虎";
        }else if (value.equals("11") || value.equals("23") || value.equals("35") || value.equals("47")){
            return "牛";
        }else if (value.equals("12") || value.equals("24") || value.equals("36") || value.equals("48")){
            return "鼠";
        }else
            return "";

    }

}
